package com.hongyuan.sellcoach.ui.member.view_mode;

import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import com.hongyuan.mvvmhabitx.binding.command.BindingCommand;
import com.hongyuan.sellcoach.base.CustomViewModel;
import com.hongyuan.sellcoach.base.ItemViewModel;
import com.hongyuan.sellcoach.ui.member.activity.MemberDetailsActivity;
import com.hongyuan.sellcoach.ui.member.beans.MembersBean;

public class MemberItemViewModel extends ItemViewModel<CustomViewModel> {

    public ObservableField<MembersBean.ListBean> entity = new ObservableField<>();

    public MemberItemViewModel(@NonNull CustomViewModel viewModel, MembersBean.ListBean bean) {
        super(viewModel);
        entity.set(bean);
    }

    //改变选中的门店
    public BindingCommand goDetails = new BindingCommand(() -> {
        Bundle bundle = new Bundle();
        bundle.putString("xy_mid",String.valueOf(entity.get().getM_id()));
        viewModel.startActivity(MemberDetailsActivity.class,bundle);
    });
}
